<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class c_jadwal extends CI_Controller {

	function __construct(){
		parent::__construct();
		checkLogin();
		$this->load->model("m_jadwal");
	}
	
	function index(){
		$task = $this->input->post("task");
		switch($task){
			case 'LIST_JADWAL' : 
				$this->list_jadwal(); 
				break;
			default : 
				$data['data_kondisi'] = $this->m_jadwal->getKondisi("combo");
				$this->load->view('v_jadwal',$data);
		}
	}
	
	function list_jadwal(){
		$page = $this->input->post('page');
		$rows = $this->input->post('rows');
		$id = $this->input->post('jadwal_id');
		$option = $this->input->post('option');
		$jadwal_namaproyek = mysql_real_escape_string($this->input->post('jadwal_namaproyek'));
		$kondisi = $this->input->post('kondisi');
		$data = $this->m_jadwal->list_jadwal($option,$id,$page,$rows,$kondisi, 	$jadwal_namaproyek  );
		echo $data;
	}

}